package com.onluy.controller.sysmgr;

import com.onluy.frameworkcloud.Param.*;
import com.onluy.frameworkcloud.data.util.InParam;
import com.onluy.servic.sysmgr.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class DeptController
{
	@Autowired
	private DeptClientService service;


	@RequestMapping(value = "/dpt/model")
	public RspInfo<InParam<String,Object>> model(InParam<String,Object> inParam)
	{
		ReqHead reqHead=new ReqHead();
		ReqInfo<ReqHead,InParam<String,Object>> reqInfo =new  ReqInfo<ReqHead,InParam<String,Object>>  ();
		reqInfo.setReqBody(inParam);
		reqInfo.setReqHead(reqHead);
		return this.service.model(reqInfo);
	}


	@RequestMapping(value = "/dpt/add")
	public RspInfo<InParam<String,Object>> add(InParam<String,Object> inParam)
	{
		ReqHead reqHead=new ReqHead();
		ReqInfo<ReqHead,InParam<String,Object>> reqInfo =new  ReqInfo<ReqHead,InParam<String,Object>>  ();
		reqInfo.setReqBody(inParam);
		reqInfo.setReqHead(reqHead);
		return this.service.add(reqInfo);
	}


	@RequestMapping(value = "/dpt/list")
	public RspInfo<PageInfo<InParam >> list(InParam<String,Object> inParam)
	{
		ParamPagination reqHead=new ParamPagination();
		reqHead.setCurrPage(1);
		reqHead.setPageSize(10);
		ReqInfo<ParamPagination, InParam<String, Object>> reqInfo =new  ReqInfo<ParamPagination, InParam<String, Object>>  ();
		reqInfo.setReqBody(inParam);
		reqInfo.setReqHead(reqHead);
		return this.service.list(reqInfo);
	}
}
